import { call, all, put, take, takeLatest } from 'redux-saga/effects';

import { actionTypes } from './actionTypes';
import * as userActions from './actions';

const {
	setUserAuth,
	logout,
	logoutSucc,
	logoutFail,
} = userActions;

function* logoutSaga () {
	put(logout());
}

function* authSaga () {
	yield all([
		takeLatest(actionTypes.LOGOUT, logoutSaga),
	]);
}

export default authSaga;